package com.colud.colud_eureka_feign.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.colud.colud_eureka_feign.service.ExampleClient;

@RefreshScope
@RestController
public class ShoppingController {
	@Autowired
	ExampleClient client;
	
	@RequestMapping(value = "/shopping" ,method = RequestMethod.GET)
    public String shopping(@RequestParam String code, @RequestParam Integer num) {
        System.out.println(num+"件"+code+"(商品编码)添加进购物车");
		return client.shopping(code, num);
    }
	
	@Value("${from}")
    private String from;
    
    @RequestMapping("/from")
    public String from() {
        return this.from;
    }
}
